<?php
class Application_Model_Schema_TileResource {
	protected $_id;
	protected $_tile;
	protected $_resource;
	protected $_actions = array();

	public function __set($name, $value) {
		$method = 'set' . $name;
		if(!method_exists($this, $method)) {
			throw new Exception('Set Invalid TileResource Property');
		}
		$this->$method($value);
	}

	public function __get($name) {
		$method = 'get' . $name;
		if(!method_exists($this, $method)) {
			throw new Exception('Get Invalid TileResource Property');
		}
		return $this->$method();
	}

	public function setId($id) {
		$this->_id = (int) $id;
		return $this;
	}

	public function getId() {
		return $this->_id;
	}		

	public function setTile($tile) {
		$this->_tile = $tile;
		return $this;
	}

	public function getTile() {
		return $this->_tile;
	}	

	public function setResource($resource) {
		$this->_resource = $resource;
		return $this;
	}

	public function getResource() {
		return $this->_resource;
	}
	
	public function setAction($action, $key = null) {
		if(isset($key)) {
			$this->_actions[$key] = $action;
			
		} else {
			$this->_actions[] = $action;
		}
		return $this;
	}
	
	
	public function setActions($actions) {
		$this->_actions = $actions;
		return $this;
	}
	

	public function getActions() {
		return $this->_actions;
	}	
}
?>